<template>
    <el-dialog :visible.sync="visible" v-dialogDrag :title="title" :close-on-click-modal="false" class="tl-dialog" width="1200px" @open="open" @close="close" :append-to-body="true">
    <el-form class="tl-form" ref="form" :model="model" :rules="rules" label-width="150px" :disabled="disableEditSubmit">
			<el-row>
				<el-col :span="12">
					<el-form-item label="公司名称" prop="companyname" :rules="rules.validateRequire">
						<el-input v-model="model.companyname" ></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="客户关系" prop="customerrelationship" :rules="rules.validateRequire">
						<el-select v-model="model.customerrelationship" filterable clearable>
							<el-option v-for="item in codeModel.customerrelationshipList" :key="item.code" :label="item.name" :value="item.code" />
						</el-select>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="产品力" prop="productpower" :rules="rules.validateRequire">
						<el-select v-model="model.productpower" filterable clearable>
							<el-option v-for="item in codeModel.productpowerList" :key="item.code" :label="item.name" :value="item.code" />
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="服务水平" prop="servicelevel" :rules="rules.validateRequire">
						<el-select v-model="model.servicelevel" filterable clearable>
							<el-option v-for="item in codeModel.servicelevelList" :key="item.code" :label="item.name" :value="item.code" />
						</el-select>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="市场份额" prop="marketshare" :rules="rules.validateRequire">
						<el-select v-model="model.marketshare" filterable clearable>
							<el-option v-for="item in codeModel.marketshareList" :key="item.code" :label="item.name" :value="item.code" />
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="价格" prop="price" :rules="rules.validateRequire">
						<el-select v-model="model.price" filterable clearable>
							<el-option v-for="item in codeModel.priceList" :key="item.code" :label="item.name" :value="item.code" />
						</el-select>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="备注" prop="description" >
						<el-input v-model="model.description" type="textarea" maxlength="1000" show-word-limit :rows="4"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button :type="disableEditSubmit === false ? 'text' : 'primary'" @click="doCancelEdit">取消</el-button>
      <el-button type="primary" @click="doSubmitEdit" :loading="saveLoading" v-if="disableEditSubmit === false">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
/** mixins */
import { mixin_edit } from '@tapui/mixins/mixin_edit'
/** 子组件 */
/** 工具类 */
import { putAction, getAction, postAction, deleteAction } from '@tapui/utils/http'
/** VUE配置 */
export default {
  mixins: [mixin_edit],
  components: { },
  data() {
    return {
      moduleTitle: '项目策划-主要竞争对手',
      urlPrefix: '/mpm/projectCompetitor/',
      url: {
        // 额外的url
      }
    }
  },
  props: {
    parentId: {
      type: [Number, String],
      default: ''
    },
    projectinfo: {

    }
  },
  methods: {
    loaded() {
      // 页面加载完毕执行
	if (this.isAdd) {
        this.$set(this.model, 'planid', this.parentId)
      }
    }
  }
}
</script>

